package com.qf.mapper;

/*
 *@Description:
 *@author:刘哥
 *@Date:86180 2022/8/31 17:10
 */

import com.qf.pojo.TbUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface UserMapper {
    @Select("select * from tb_user")
    List<TbUser> findPageUser(int pageNum, int pageSize);

    @Update("update tb_user set username=#{tbUser.username},password=#{tbUser.password},gender=#{tbUser.gender} where id=#{user.id}")
    void updateUser(TbUser tbUser);

    @Select("select * from tb_user where id=#{id}")
    TbUser findById(long id);

    @Delete("delete from tb_user where id=#{id}")
    void deleteById(long id);
}
